@extends('layout.home')

@section('youpian')
@endsection

@section('head-top')
@endsection

@section('return')
<p class="log">
    <a href="/home/index">
        首页
    </a>
    <span>
    </span>
    <a href="/home/login">
        登录
    </a>
</p> 
@endsection
@section('content')
	<div class="container">
	<div class="register">
		
		<h2>密码修改</h2>
		  	<form action='/home/reset' method="post"> 
				<div class="col-md-7 col-md-offset-3 register-top-grid" style='margin-bottom:70px'>
					<ul class="list-unstyled list-inline mation" >
						<li><span>密&nbsp;&nbsp;码</span></li>
						<li><input type="password" name='password'></li>
						<li><span></span></li>
						
					</ul>
					<ul class="list-unstyled list-inline mation" >
						<li><span>确认密码</span></li>
						<li><input type="password" name='repassword'></li>
						<li><span></span></li>
						
					</ul>
					<div class="clearfix"> </div>
				 	<ul class='list-unstyled list-inline'>
						<li style='margin-left:106px'>
						 	<div class="register-but">
						 		{{csrf_field()}}
						 		<input type="hidden" name='id' value='{{$id}}'>
						 		<button class='btn btn-info zhuce' style='width:100px'>确认修改</button>
								<div class="clearfix"> </div>
							</div>
						</li>
					</ul>
		   		</div>
		    </form>
	</div>

	<script src='/homes/js/jquery-1.8.3.min.js'></script>
	<script>
		$('input[name=password]').focus(function(){
			$(this).css('border','solid 1px blue');
			$(this).parent().next().show().html('请输入6-20字母数字下划线').css('color','#888');
			CPASS = false;
		});

		// 丧失焦点
		$('input[name=password]').blur(function(){
			var v = $(this).val();
			var rv = $('input[name=password]').val();
			var reg = /^\w{6,20}$/;
			if(!reg.test(v)){
				$(this).css('border','solid 1px red');
				$(this).parent().next().html('输入有误，请重新输入').css('color','red');
			}else if(v!=rv){
				$(this).css('border','solid 1px red');
				$(this).parent().next().show().html('两次密码输入不一致,请重新输入').css('color','red');
			}else{
				$(this).css('border','solid 1px #ddd');
				$(this).parent().next().show().html('√').css('color','green');
			}
		});

		// 检测确认密码
		$('input[name=repassword]').focus(function(){
			$(this).css('border','solid 1px blue');
			$(this).next().show().html('请输入6-20字母数字下划线').css('color','#888');
			CPASS = false;
		});

		// // 丧失焦点
		$('input[name=repassword]').blur(function(){
			var v = $(this).val();
			var rv = $('input[name=password]').val();
			var reg = /^\w{6,20}$/;
			if(!reg.test(v)){
				$(this).css('border','solid 1px red');
				$(this).next().html('输入有误，请重新输入').css('color','red');
			}else if(v!=rv){
				$(this).css('border','solid 1px red');
				$(this).parent().next().html('两次密码输入不一致,请重新输入').css('color','red');
			}else{
				$(this).css('border','solid 1px #ddd');
				$(this).parent().next().show().html('√').css('color','green');
			}
		});
	</script>
	@endsection